﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace NUnitTest.UnitTest.Targets
{
    [TestFixture]
    public class TestException
    {
        [Test]
        public void UnexpectedExceptionTestShouldFail()
        {
            throw new InvalidOperationException();
        }
        
        [Test]
        [ExpectedException(typeof(NullReferenceException))]
        public void ExpectedExceptionTest()
        {
            throw new NullReferenceException();
        }

        [Test]
        [ExpectedException(typeof(InvalidCastException))]
        public void WrongExceptionTestShouldFail()
        {
            throw new NullReferenceException();
        }

        [Test]
        [ExpectedException(typeof(InvalidCastException))]
        public void NoExceptionTestShouldFail()
        {
            //Everything gone well ???
        }

        //[Test]
        //[ExpectedException(typeof(SPException))]
        //public void IncludedExceptionFromOtherDLL()
        //{
        //    throw new SPException();
        //}
    
    }
}
